package main

import (
	"fmt"
	"strings"
)

func main() {

	var str string = "abc中国"
	fmt.Println(str)
	//-1表示替换 全部
	replace := strings.Replace("go go hello", "go", "go语言", -1)
	fmt.Println("字符串替换", replace)

	//切割
	split := strings.Split("gosgos", "s")
	fmt.Println(len(split))
	for i := range split {
		fmt.Println(split[i])
	}

	prefix := strings.HasPrefix("http://", "http")
	fmt.Println("HasPrefix ", prefix)

}
